package com.springboot.demo.web;
import com.springboot.demo.entity.Record;
import com.springboot.demo.service.RBorrowRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.List;

@Controller
public class RBorrowRecordController {
    @Autowired
    private RBorrowRecordService rBorrowRecordService;
    @RequestMapping(value = "/reader_borrow",method = RequestMethod.POST)
    @ResponseBody
    public List<Record> reader_borrow(String phone) throws UnsupportedEncodingException {
        List<Record> list = new ArrayList<>();
        list.addAll(rBorrowRecordService.getPhone(phone));
        return list;
    }
}